// ignore_for_file: file_names, must_be_immutable

import 'package:flutter/material.dart';

class MyApp1 extends StatelessWidget {
  MyApp1({super.key, required this.age});
  int age;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //1.导航
      appBar: AppBar(
        title: const Text('无状态组件'),
        backgroundColor: Colors.pink,
      ),
      //2.内容
      body: Center(
        child: Text('无状态组件,今年$age岁'),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          // setState({ //只能在有状态组件中使用
          //   print('点击了按钮');
          //   age++;
          // });
        },
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
